package com.plian.system.controller.sys.per;
import com.plian.Tools.pagedata.PageData;
import com.plian.system.model.ListResult;
import com.plian.system.model.ObjResult;
import com.plian.system.service.sys.per.UserOrgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * 账号-单位权限
 */
@RestController
@RequestMapping(value = "api/userOrg")
public class UserOrgController {
    @Autowired
    UserOrgService userOrgService;
    /**
     * 配置用户单位
     */
    @PostMapping(value = "/config")
    public ObjResult userOrgConfig(@RequestBody PageData pd) throws Exception {
        return userOrgService.userOrgConfig(pd);
    }
    /**
     * 根据用户id查询有权限的单位
     * @param pd
     * @throws Exception
     * @return
     */
    @PostMapping(value = "/queryUserOrg")
    public ObjResult queryUserOrg(@RequestBody PageData pd) throws Exception {
       return userOrgService.UserOrg(pd);
    }
    @PostMapping(value = "/getUserByOrgId")
    public ListResult getUserByOrgId(@RequestBody PageData pd) throws Exception {
       return userOrgService.getUserByOrgId(pd);
    }
}
